package com.meritdata.cloud.data.service.development.repository;

import com.meritdata.cloud.data.service.development.model.DataApi;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.querydsl.QuerydslPredicateExecutor;

import javax.transaction.Transactional;
import java.util.Date;


public interface IDataApiDao extends JpaRepository<DataApi,Long>, QuerydslPredicateExecutor<DataApi> {
    @Modifying
    @Transactional
    @Query("update DataApi as c set c.name=:name ,c.updateTime=:updateTime,c.type=:type,c.description=:description,c.url=:url where c.id=:id")
    public int update(Long id, String name, String url, String description, String type, Date updateTime);
}
